function res = DO_StepResponse(obj, app, pVal, iVal, dVal, value1, hold_time1, value2, hold_time2)
%DO_STEPRESPONSE Summary of this function goes here
%   Detailed explanation goes here
    
    %%
    res.PValue = pVal;
    res.IValue = iVal;
    res.DValue = dVal;
    res.setTemperature1 = value1;
    res.holdTime1 = hold_time1;
    res.setTemperature2 = value2;
    res.holdTime2 = hold_time2;

    %%    
    obj.setPValue(pVal);
    obj.setIValue(iVal);
    obj.setDValue(dVal);    
    obj.setAutoControl(); % close loop control

    obj.clear_buffer();
    
    
    app.gui_program_control();
    %% Proc 1
    fprintf('%s, Cooling Process, Set Target Temperature = %5.3f, for %d s.\n', ...
            datestr(now,'yyyy-mm-dd HH:MM:SS,FFF'), value1, hold_time1);
    res.start_time = datetime('now');
    obj.stopRecord().setTargetTemperature(value1).update_GUI().startRecord();
    pause(hold_time1);
    
    %% Proc 2
    fprintf('%s, Heating Process, Set Target Temperature = %5.3f, for %d s.\n', ...
            datestr(now,'yyyy-mm-dd HH:MM:SS,FFF'), value2, hold_time2);
    res.step_time = datetime('now');
    obj.stopRecord().setTargetTemperature(value2).update_GUI().startRecord();
    pause(hold_time2);
    
    res.stop_time = datetime('now');
    obj.stopRecord;
        
    [tList, data]  = obj.getBufferData;
    res.tList = tList;
    res.data = data;
end

